//
//  WIFIDeviceSettingViewController.m
//  Router
//
//  Created by teki on 15/11/4.
//  Copyright © 2015年 dc. All rights reserved.
//

#import "WIFIDeviceSettingViewController.h"
#import "XLScrollViewer.h"
#import "WIFIDeviceSetting.h"
#import "LoginResponseModel.h"

@interface WIFIDeviceSettingViewController ()
@property(nonatomic ,strong)XLScrollViewer *scroll;
@property (nonatomic, strong) NSMutableArray *contentArray;
@end

@implementation WIFIDeviceSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"小叶WIFI管理";
    
    NSArray *array = [UserSingleton shareInstance].userModel.stations;
    self.contentArray = [NSMutableArray arrayWithArray:array];
//    [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//        [self.contentArray addObject:obj];
//    }];
//    
//    
//    [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//        [self.contentArray addObject:obj];
//    }];
////    [self.contentArray addObjectsFromArray:array];

    [self initContentView];

    // Do any additional setup after loading the view.
}


- (void)initContentView
{
    NSMutableArray *views = [NSMutableArray array];
    
    NSMutableArray *names = [NSMutableArray array];
    for (NSInteger i = 0; i< [self.contentArray count]; i++) {
        WIFIDeviceSetting *settingView = [[WIFIDeviceSetting alloc] init];
        settingView.stationModel = self.contentArray[i];
        [views addObject:settingView];
        
        NSString *string = [NSString stringWithFormat:@"%02ld",(long)i+1];
        [names addObject:string];
    }
    
    
    //创建使用
    self.scroll =[XLScrollViewer scrollWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - 64) withViews:views withButtonNames:names withThreeAnimation:ChooseTypeMoveSlider];//三中动画都选择
    self.scroll.backgroundColor  = [UIColor whiteColor];
    self.scroll.selectedIndex = self.selectedIndex;
    //自定义各种属性。。打开查看
    self.scroll.xl_topBackColor =RGB(224, 244, 221);
    self.scroll.xl_sliderColor = NavgationBarBackgroundColor;
    self.scroll.xl_buttonColorNormal = RGB(179, 182, 178);
    self.scroll.xl_buttonColorSelected = NavgationBarBackgroundColor;
    self.scroll.xl_buttonFont =12;
    self.scroll.xl_buttonToSlider = 5;
    self.scroll.xl_sliderHeight =5;
    self.scroll.xl_topHeight =40;
    self.scroll.xl_isSliderCorner =NO;
    
    //加入控制器视图
    [self.view addSubview:self.scroll];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




@end
